ruby:
  show_nav         ||= false
  navigation_items ||= []
  records          ||= []

ul.search-results.js-search-results

  - if show_nav && @fae_topnav_items.present?

    - @fae_topnav_items.each do |item|
      li.search-topnav
        a href=item[:nested_path] = item[:text]
        - if item[:subitems]
          ul
            - item[:subitems].each do |subitem|
              li: a href=subitem[:nested_path] = subitem[:text]

  - elsif navigation_items.present? || records.present?

    - if navigation_items.present?
      - navigation_items.each do |item|
        li: a.search-nav-item href=item[:nested_path] = item[:text]

    - if records.present?
      - records.each do |item|
        - begin
          - parent = item.respond_to?(:fae_parent) ? item.fae_parent : nil
          - edit_path = edit_polymorphic_path([main_app, fae_scope.to_sym, parent, item])
          li
            a href=edit_path
              span.search-record-label = item.class.name
              = item.fae_display_field
        - rescue

  - else

    li = t('fae.navbar.no_results')
